package com.itheima.service.impl;

import com.itheima.domain.Trip;
import com.itheima.mapper.TripMapper;
import com.itheima.service.TripService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TripServiceImpl implements TripService {
    //从IOC容器中获取对象
    @Autowired
    private TripMapper tripMapper;

    public List<Trip> queryTripAll() {

        return tripMapper.queryTripAll();
    }

    public void addTrip(Trip trip) {
        tripMapper.addTrip(trip);
    }

    public Trip queryTripById(int id) {
        return tripMapper.queryTripById(id);
    }

    public void updateTripById(Trip trip) {
        tripMapper.updateTripById(trip);
    }

    public void deleteTripById(int id) {
        tripMapper.deleteTripById(id);
    }
}
